<?php  
use yii\helpers\Html;
use yii\helpers\Url;
use backend\components\SideNavWidget;
?>
<div class="col-md-2">
    <?php
    //左侧菜单
    $menuItem = [];
    if ($access = Yii::$app->params['access']) {
        isset($access['USER']['INDEX']) && $menuItem[] = ['label' => '用户管理', 'url' => ['/user/index']];
        isset($access['USER']['TEACHER']) && $menuItem[] = ['label' => '教师管理', 'url' => ['/user/teacher']];
        isset($access['USER']['ADMIN']) && $menuItem[] = ['label' => '管理员管理', 'url' => ['/user/admin']];
    } else {
        $menuItem = [
            ['label' => '用户管理', 'url' => ['/user/index']],
            ['label' => '教师管理', 'url' => ['/user/teacher']],
            ['label' => '管理员管理', 'url' => ['/user/admin']],
        ];
    }

    
    
    echo SideNavWidget::widget([
        'options' => ['class' => 'list-group'],
        'items' => $menuItem,
    ]);

    
    ?>
</div>